package cn.edu.sgu.www.mhxysy.dto.prop;

import cn.edu.sgu.www.mhxysy.consts.CustomMessages;
import cn.edu.sgu.www.mhxysy.consts.RegExps;
import cn.edu.sgu.www.mhxysy.dto.DataTransferObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Positive;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Data
@ApiModel
public class PropDTO implements DataTransferObject {

    @ApiModelProperty(value = "ID")
    private String id;

    /**
     * 冻结天数
     */
    @Range(min = -1, max = 60, message = "冻结天数" + CustomMessages.ILLEGAL)
    @NotNull(message = "冻结天数" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "冻结天数", required = true)
    private Integer days;

    /**
     * 是否珍品
     * 0-非珍品；1-珍品
     */
    @Range(min = 0, max = 1, message = "是否珍品" + CustomMessages.ILLEGAL)
    @NotNull(message = "是否珍品" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "是否珍品", required = true)
    private Integer rarity;

    /**
     * 绑定状态
     */
    @Positive(message = "绑定状态" + CustomMessages.ILLEGAL)
    @NotNull(message = "绑定状态" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "绑定状态", required = true)
    private Integer bindState;

    /**
     * 耐久度
     */
    @ApiModelProperty(value = "耐久度")
    private Integer durability;

    /**
     * 道具类型ID
     */
    @NotBlank(message = "道具类型" + CustomMessages.ID_NOT_NULL)
    @ApiModelProperty(value = "道具类型ID", required = true)
    private String propId;

    /**
     * 角色ID
     */
    @Pattern(regexp = RegExps.ROLE_ID, message = "角色ID" + CustomMessages.ILLEGAL)
    @NotBlank(message = CustomMessages.ROLE_ID_NOT_NULL)
    @ApiModelProperty(value = "角色ID", required = true)
    private String roleId;

    /**
     * 数据ID
     */
    @ApiModelProperty(value = "数据ID")
    private String dataId;

    /**
     * 道具品质
     */
    @ApiModelProperty(value = "道具品质")
    private Integer quality;

    /**
     * 父类型ID
     */
    @ApiModelProperty(value = "父类型ID")
    private String parentId;

    /**
     * 数据库表名
     */
    @ApiModelProperty(value = "数据库表名")
    private String tableName;
}